package com.cusconsumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.pojo.Customer;
import com.pojo.Staff;
import com.service.CustomerService;
import com.service.StaffService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin //(origins = {"http://localhost:8088/"})//跨域问题
@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Reference
    private CustomerService ctService;

    @CrossOrigin
    @RequestMapping("/customerList")
    public List<Customer> customerList(){return ctService.getCustomer();}

    @RequestMapping("/customerAdd")
    public int  customerAdd(Customer customer){return ctService.customerAdd(customer);}

    @RequestMapping("/customerUpdate")
    public int  customerUpdate(Customer customer){return ctService.customerUpdate(customer);}

    @RequestMapping("/customerDelete")
    public int  customerUpdate(int id){return ctService.customerDelete(id);}

}
